/**
 * 路由组件
 */
import React, { lazy, Suspense } from 'react'
import { Switch, Route } from 'react-router-dom'
// 导入加载提示组件
import Loading from '../component/Loading'
// 导入需要懒加载的组件
const shouye = lazy(() => import('../views/user/Index'))
const kongzhiye = lazy(() => import('../views/user/Controlpage/Index'))
const xiangqingye = lazy(() => import('../views/user/detailpage/Index'))
const caozuoye = lazy(() => import('../views/user/operationlog/Index'))
const shujuye = lazy(() => import('../views/user/dataanalysis/Index'))
const Tongji = lazy(() => import('../views/user/dataanalysis/Tongji'))
const Index = () => {

    return (
        <Suspense fallback={<Loading />}>
                    <Switch>
                        {/* <Route path="/dashboard/user/index" component={Welcome} /> */}
                        <Route path="/dashboard/welcome" component={shouye}  />
                        <Route path="/dashboard/controlpage/index" component={kongzhiye}  />
                        <Route path="/dashboard/detailpage/index" component={xiangqingye}  />
                        <Route path="/dashboard/operationlog/index" component={caozuoye}  />
                        <Route path="/dashboard/dataanalysis/index" component={shujuye}  />   
                        <Route path="/dashboard/dataanalysis/tongji" component={Tongji}  />   
                    </Switch>
        </Suspense>
    )
}

export default Index
